package com.lagou.kafka_homework.consumer;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class TrackConsumer {

    @KafkaListener(topics = "track")
    public void onMessage(ConsumerRecord<Integer,String > record){
        System.out.println("消费者收到的消息" + record.topic() + "\t" + record.key() + "\t" + record.value() + "\t" + record.partition());
    }
}
